package com.xiaofeng.service.iserviceimpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xiaofeng.common.Const;
import com.xiaofeng.dao.idao.UserDao;
import com.xiaofeng.pojo.User;
import com.xiaofeng.service.iservice.Userservice;


@Service("userService")
public class UserServcieImpl implements Userservice{

	@Autowired
	private UserDao userDao;
	@Override
	public String registry(User user) {
		String msg = Const.ERROR;
		try {
			userDao.registry(user);
			msg = Const.SUCCESS;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return msg;
	}

	@Override
	public User login(User user) {
		User u = null;
		try {
			u = userDao.login(user);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return u;
	}

}
